Optimal. Leaf size=99 \[ \frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}+\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) (A-i B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3596, 12, 3544, 205} \[ \frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}+\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) (A-i B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 205
Rule 3544
Rule 3596
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}} \, dx &=\frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}+\frac {\int \frac {a (A-i B) \sqrt {a+i a \tan (c+d x)}}{2 \sqrt {\tan (c+d x)}} \, dx}{a^2}\\ &=\frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}+\frac {(A-i B) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx}{2 a}\\ &=\frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}-\frac {(a (i A+B)) \operatorname {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=-\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {(A+i B) \sqrt {\tan (c+d x)}}{d \sqrt {a+i a \tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.57, size = 123, normalized size = 1.24 \[ \frac {\sqrt {\tan (c+d x)} \left ((A+i B) \sqrt {-1+e^{2 i (c+d x)}}+(A-i B) e^{i (c+d x)} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right )\right )}{d \sqrt {-1+e^{2 i (c+d x)}} \sqrt {a+i a \tan (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.83, size = 400, normalized size = 4.04 \[ \frac {{\left (a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (\frac {i \, a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) - a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (\frac {-i \, a d \sqrt {\frac {-2 i \, A^{2} - 4 \, A B + 2 i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) + 2 \, \sqrt {2} {\left ({\left (A + i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.37, size = 639, normalized size = 6.45 \[ -\frac {\left (\sqrt {\tan }\left (d x +c \right )\right ) \sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{2}\left (d x +c \right )\right ) a -2 i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \tan \left (d x +c \right ) a +B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \left (\tan ^{2}\left (d x +c \right )\right ) a -i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a +4 i A \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \tan \left (d x +c \right )+2 A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) \tan \left (d x +c \right ) a +4 i B \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}-B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a -4 B \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \tan \left (d x +c \right )+4 A \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\right )}{4 d a \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \left (-\tan \left (d x +c \right )+i\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.62, size = 426, normalized size = 4.30 \[ \frac {B\,\ln \left (\frac {\sqrt {a}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (2-2{}\mathrm {i}\right )}{\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}}-\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}+1{}\mathrm {i}\right )\,\left (\frac {1}{4}+\frac {1}{4}{}\mathrm {i}\right )}{\sqrt {a}\,d}+\frac {A\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,2{}\mathrm {i}}{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )\,\left (d\,1{}\mathrm {i}-\frac {a\,d\,\mathrm {tan}\left (c+d\,x\right )}{{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}\right )}-\frac {2\,B\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )\,\left (d\,1{}\mathrm {i}-\frac {a\,d\,\mathrm {tan}\left (c+d\,x\right )}{{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}\right )}-\frac {\sqrt {\frac {1}{8}{}\mathrm {i}}\,B\,\ln \left (-\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}+\frac {2\,{\left (-1\right )}^{3/4}\,\sqrt {2}\,\sqrt {a}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}}+1{}\mathrm {i}\right )}{\sqrt {a}\,d}+\frac {2\,\sqrt {\frac {1}{8}{}\mathrm {i}}\,A\,\mathrm {atanh}\left (\frac {32\,\sqrt {\frac {1}{8}{}\mathrm {i}}\,A^2\,{\left (-a\right )}^{9/2}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{\left (A^2\,a^4\,4{}\mathrm {i}-\frac {4\,A^2\,a^5\,\mathrm {tan}\left (c+d\,x\right )}{{\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}^2}\right )\,\left (\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}-\sqrt {a}\right )}\right )}{\sqrt {-a}\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {A + B \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \sqrt {\tan {\left (c + d x \right )}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________